package com.cn.parks.dao;

import com.cn.parks.entity.ParkingSeat;
import java.util.List;

public interface ParkingSeatDao {
    // 添加车位
    int insert(ParkingSeat parkingSeat) throws Exception;
    
    // 删除车位
    int deleteById(String seatId) throws Exception;
    
    // 更新车位信息
    int update(ParkingSeat parkingSeat) throws Exception;
    
    // 根据ID查询车位
    ParkingSeat getById(String seatId) throws Exception;

    //根据车位编号查询车辆ID
    Integer getByCarId(String seatNum) throws Exception;

    // 根据车位编号查询车位状态：0空闲 1已占用 2维护中
    Integer getBySeatNum(String seatNum) throws Exception;

    //根据车位编号查询车位类型：固定 临时 VIP
    String getSeatTag(String seatNum) throws Exception;

    //根据车位编号修改车位状态
    void updateSeatState(String seatNum, Integer carId, String carNum, Integer userId) throws Exception;

    //根据车辆ID修改车位状态
    void updateSeatStateByCarId(Integer carId) throws Exception;

    // 查询所有车位
    List<ParkingSeat> getAll() throws Exception;
    
    // 根据区域查询车位
    List<ParkingSeat> getBySection(String section) throws Exception;
    
    // 查询空闲车位
    List<ParkingSeat> getAvailableSeats() throws Exception;

    // 查询临时空闲车位
    List<ParkingSeat> getTempAvailableSeats() throws Exception;

    // 查询所有车位数量
    Integer getParkCount() throws Exception;

    //查询空闲车位数量
    Integer getAvailableCount() throws Exception;

    //使用车位编号查询此编号是否存在
    String getSeatNum(String seatNum) throws Exception;

    //查询固定和VIP空闲错误
    List<ParkingSeat> getFixedAndVip() throws Exception;

    // 更新车位状态
    int updateState(String seatId, Integer state) throws Exception;
} 